package com.foreveredu.erlms.domain;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

/*
 * @author hushigang 2012/4/10
 * 领域模型类——考生
 */
@Entity
@Table(name = "examinee")
public class Examinee implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;// 编号
	private String idCard;// 身份证号码
	private String ticketNumber;// 准考证号，需要手工编排
	private String enrollNumber;// 报名号，由系统生成，420092+等级代码+报名序号，共14位，例如：42009215000001，其中后6位序号不论等级依次递增。当考生现场确认后由系统生成。
	private String serialNumber;// 网报号，由系统生成，420092+报名序号，共12位，例如：420092000001
	private int examOrder;// 全国计算机等级考试届次
    private Enroll enroll;
	 
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	@Column
	public String getTicketNumber() {
		return ticketNumber;
	}

	public void setTicketNumber(String ticketNumber) {
		this.ticketNumber = ticketNumber;
	}

	@Column
	public String getEnrollNumber() {
		return enrollNumber;
	}

	public void setEnrollNumber(String enrollNumber) {
		this.enrollNumber = enrollNumber;
	}
	
	@Column
	public int getExamOrder() {
		return examOrder;
	}

	
	public void setExamOrder(int examOrder) {
		this.examOrder = examOrder;
	}

	@Column
	public String getSerialNumber() {
		return serialNumber;
	}
	
	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}
	@OneToOne(cascade=CascadeType.ALL)
	@JoinColumn(name = "enroll_id")
	public Enroll getEnroll() {
		return enroll;
	}

	public void setEnroll(Enroll enroll) {
		this.enroll = enroll;
	}
}
